/*
 * Create Date 2006-5-19
 */
package afss.freesky.data.conn;

import java.sql.DriverManager;

/**
 * Title: FreeSky Common Java Library <br>
 * Description: FreeSky Common Java Library <br>
 * Copyright: Copyright (c) 2005~2009 www.afss.cn <br>
 * Company: Amei's FreeSky Studio <br>
 * 
 * @author <b>Jacky Chou</b> (AFSS [Amei's FreeSky Studio])
 * @version 1.2.0, 2008-02-23, Upgrade freesky.jar to 1.2.0 with Struts 2 <br>
 *          1.0.0, 2006-05-30, Initial Version
 */
public class DBSql2k5Bean extends DBConnBean {
	/**
     *
     */
	private static final long serialVersionUID = -4451777563654845691L;
	public static String URL = "jdbc:sqlserver://localhost:1433;DatabaseName=freesky";
	public static String USER = "sa";
	public static String PASSWORD = "sa";

	public DBSql2k5Bean() {
		super();
	}

	/*
	 * @see afss.freesky.common.db.IDBConn#getConnection()
	 */

	public void getConnection() {
		try {
			Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")
					.newInstance();
			conn = DriverManager.getConnection(URL, USER, PASSWORD);
		} catch (java.lang.ClassNotFoundException ce) {
			logger.error("Get Connection error:", ce);
		} catch (java.sql.SQLException se) {
			logger.error("Get Connection error:", se);
		} catch (Exception e) {
			logger.error("Get Connection error:", e);
		}
	}

	/*
	 * ���� Javadoc��
	 * 
	 * @see afss.freesky.common.db.IDBConn#setDBConnInfo(java.lang.String,
	 * java.lang.String, java.lang.String, java.lang.String)
	 */

	public static void setDBConnInfo(String dbIP, String dbName, String dbUser,
			String dbPassword) {
		URL = "jdbc:sqlserver://" + dbIP + ":1433;DatabaseName=" + dbName;
		USER = dbUser;
		PASSWORD = dbPassword;
	}
}
